import _ from "lodash";
var formItem = {
  cmpnt: "ElFormItem",
  props: {
    "label-width": "auto",
  },
  children: [],
  _ctl: {
    name: "FormItem",
    text: "表单项",
  },
};

var Search = {
  cmpnt: "ElForm",
  props: {
    "label-width": "auto",
    "label-position": "right",
    "label-suffix": "",
    inline: true,
    size: "small",
    "show-message": true,
    "inline-message": true,
    "status-icon": false,
    "validate-on-rule-change": true,
    "scroll-to-error": false,
    rules: [],
  },

  push: function (ele) {
    let item = _.cloneDeep(formItem);
    item.children = [ele];
    item.props.label = ele.props.label;
    this.children.push(item);
  },
  remove: function (ele) {
    let index = this.children.indexOf(ele);
    if (index != -1) {
      this.children.splice(index, 1);
    }
  },
  children: [],
  style: { minHeight: "80px", minWidth: "100px" },
  class: ["px-2", "w-100"],
  events: {
    "submit.prevent": function () {},
    validate: function (prop, isValid, message) {},
  },
  _ctl: {
    icon: "iconfont te-i-form",
    name: "Search",
    text: "搜索",
  },
};
export default { Search };
